<html><head><title>DesktopMouseX</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">DesktopMouseX()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>DesktopMouseX</b></font>()</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Returns the absolute x position of the mouse on the desktop. 

</blockquote><p><b>Parameters</b></p><blockquote>
None.


</blockquote><p><b>Return value</b></p><blockquote>

Returns the x coordinate (in pixel) of the mouse relative to the top left corner of the primary monitor. 
The coordinate is negative if the mouse is on a monitor to the left of the primary monitor. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 300, 30, &quot;Desktop mouse monitor&quot;, <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    TextGadget</font>(0, 10, 6, 200, 20, &quot;&quot;)

    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WindowEvent</font>()

      <b><font color="#3A3966">If</font></b> Event = 0 <font color="#3A3966">; No events are in queue anymore, so halt the process for a few milliseconds for multitasking</font>
<font color="#3A3966">        SetGadgetText</font>(0, &quot;Desktop mouse position: &quot;+<font color="#3A3966">Str</font>(<font color="#3A3966">DesktopMouseX</font>())+&quot;,&quot;+<font color="#3A3966">Str</font>(<font color="#3A3966">DesktopMouseY</font>()))
<font color="#3A3966">        Delay</font>(20)
      <b><font color="#3A3966">EndIf</font></b>

    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="desktopmousey.html">DesktopMouseY()</a>, <a href="desktopx.html">DesktopX()</a>, <a href="desktopwidth.html">DesktopWidth()</a>, <a href="../window/windowmousex.html">WindowMouseX()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=desktopheight.html>DesktopHeight()</a> - <a href="index.html">Desktop Index</a> - <a href="desktopmousey.html">DesktopMouseY()</a> -><br><br>

</body></html>